
public class Validator<T> {

	public boolean validate(T object) {
		
		if (object instanceof User) {
			User user = (User) object;
			return user.getName().matches("[a-zA-Z]*");
		}
		
		if (object instanceof Car) {
			Car car = (Car) object;
			return car.getBrand().matches("[a-zA-Z]*");
		}
		return false;
		
		
	}

}
